/*
 * Copyright (c) 2009, Jan Pastor. All Rights Reserved.
 */

package sk.jp.jitag.ui.thumb;

import java.awt.Component;
import javax.swing.ListCellRenderer;
import javax.swing.JList;

/**
 * {@link JList} cell renderer for thumbnails.
 */
public class ThumbnailListRenderer implements ListCellRenderer {

    public Component getListCellRendererComponent(JList list, Object value, int index,
                                                  boolean isSelected, boolean cellHasFocus) {
        AbstractFileThumbnail thumbnail = (AbstractFileThumbnail) value;
        thumbnail.setSelected(isSelected);
        thumbnail.setFocused(cellHasFocus);
        return thumbnail;
    }

}
